<html>
<head>
	<script src="settings.js"></script>
	
<script type="text/javascript">

function testTrim() {
	assertNotUndefined("trim function doesn't exist", "".trim);
	assertEquals("not removing leading and trailing spaces", "  test me! !  ".trim(), "test me! !");
	assertEquals("trim removing leading Ss", "stuff to fix".trim(), "stuff to fix");
}

function testEmpty() {
	assertEquals("", String.Empty);
}

function testStartsWith() {
	assertTrue("startsWith true", "(te)st".startsWith("(te)"));
	assertFalse("startsWith false", "test".startsWith("est"));
}

function testEndsWith() {
	assertTrue("endsWith true", "te(st)".endsWith("(st)"));
	assertFalse("endsWith false", "test".endsWith("s"));
}

function testContains() {
	assertTrue("test".contains("te"));
	assertTrue("test".contains("st"));
	assertFalse("test".contains("se"));
}

function testContainsIgnoreCase() {
	assertTrue("test".containsIgnoreCase("TE"));
	assertTrue("test".containsIgnoreCase("sT"));
	assertFalse("test".containsIgnoreCase("SE"));
}

function testEqualsIgnoreCase() {
	assertTrue("case-insensitivity", "a simple test".equalsIgnoreCase("A Simple TesT"));
	assertFalse("null check", "null".equalsIgnoreCase(null));
}

function testFormat() {
	assertEquals("test this", String.format("{0} {1}", "test", "this"));
	assertEquals("test this test {2}", String.format("{1} {0} {1} {2}", "this", "test"));
	assertEquals("test this test {2}", "{1} {0} {1} {2}".format("this", "test"));
}
</script>
</head>
</html>